
/**
 * 水果单项订单
 */
public class FuitItemOrder {

    /**
     * 购买的水果
     */
    private Fruit fruit;


    /**
     * 购买的数量
     */
    private Integer quantity;


    /**
     * 单项总价
     */
    private Double total;


    /**
     * 计算单项总价
     * @return
     */
    public Double calcTotal() {
        total = fruit.getPrice() * quantity* fruit.getWeight();
        return total;
    }


    public Fruit getFruit() {
        return fruit;
    }

    public void setFruit(Fruit fruit) {
        this.fruit = fruit;
    }

    public Integer getQuantity() {
        return quantity;
    }

    public void setQuantity(Integer quantity) {
        this.quantity = quantity;
    }

    public Double getTotal() {
        return total;
    }

    public void setTotal(Double total) {
        this.total = total;
    }
}
